<?php

namespace App\Http\Requests;

class AddressSaveRequest extends BaseRequest {
    /**
     * Get the validation rules that apply to the request.
     * @return string[]
     */
    public function rules(): array
    {
        return [
            'name' => 'required|string',
            'province' => 'required',
            'city' => 'required',
            'country' => 'required',
            'address_detail' => 'required',
            'tel' => 'required',
        ];
    }

    public function messages(): array
    {
        return [
            'name.required' => '收货人名称不能为空',
            'name.string' => '收货人名称格式不正确',
            'province.required' => '行政区域省ID不能为空',
            'city.required' => '行政区域市ID不能为空',
            'country.required' => '行政区域县ID不能为空',
            'address_detail.required' => '详细地址不能为空',
            'tel.required' => '收获人手机号不能为空',
        ];
    }
}
